1. Field of the Invention
The present invention relates to the field of computer networks. More particularly, the present invention relates to a per user routing table indexed by an IP address and a network routing table to more efficiently route packets in systems where a user may connect to multiple networks.
2. The Background
The Transmission Control Protocol/Internet Protocol (TCP/IP) is a common networking protocol which has become even more popular during the rise of the Internet. Sending or receiving information using the TCP/IP protocol requires encapsulating information into packets. Each packet includes a header and a payload. The header contains information related to the handling of the payload by a receiving host or routing device, while the payload contains part or all of the user information. The information in the header includes the sender""s and the recipient""s addresses and is used to route the packet through the Internet until the packet is received by a host having an IP address that matches the packet""s destination address (when referring to the source address and destination address of a packet, the source address and destination address are commonly referred to as xe2x80x9cSAxe2x80x9d and xe2x80x9cDAxe2x80x9d, respectively). This enables users to accurately send and receive information to and from each other through their respective host computers.
In recent years, xe2x80x9cintranetsxe2x80x9d have been rising in popularity, especially with large companies. An intranet is an internal network that serves only a specific type of person (such as employees of a corporation, or students at a school). The intranet is usually not accessible to the general public. Intranets have become popular mainly because they allow for much more productive communication between users within the network, even when the users are dispersed over a wide geographic area (such as in multi-national corporations).
FIG. 1 is a block diagram depicting one way to connect to an intranet. Personal computer 10 connects through a link 12, generally a Point-to-Point Protocol (PPP) link, to an Internet service provider (ISP) or access point (AP) 14. The ISP or AP 14 then connects through link 16 to the Intranet 18.
Recently, it has become possible to have simultaneous connection to multiple networks from a single link. The ISP may utilize a gateway to interface the user and the multiple networks. A gateway is a device which performs protocol conversion between different types of networks or applications. The term gateway is not meant to be limited to a single type of device, as any device, hardware or software, that may act as a bridge between the user and the networks may be considered a gateway for purposes of this application. FIG. 2 is a diagram illustrating the use of a gateway to couple multiple networks. Computer 80 connects to gateway 82 through a modem 84, while computers 86a and 86b couple to a router 88, then through modem 90 to gateway 82. Gateway 82 may then interface computers 80, 86a, and 86b to multiple networks. These may include a first corporate intranet 92, a second corporate intranet 94, and the Internet 96.
A problem occurs at the gateway level, however, in determining to which network to route a packet sent by the user. This is further complicated by the fact that most gateways support multiple simultaneous users, each potentially having access to different multiple simultaneous networks.
What is needed is a solution which effectively manages the routing chores of a gateway in a system with users capable of simultaneous connection to multiple networks.
An additional routing problem is encountered when the decision to which network to route the packet is made and the packet is actually forwarded to that network. Due to the geographic distances between (or within) most ISPs, traffic is generally passed to networks through the use of xe2x80x9chopsxe2x80x9d. In order to get a packet to its destination, an ISP passes the packet to a first hop. Each hop is generally a gateway or router which passes the packet along to the next hop, until it eventually reaches its destination. FIG. 3 is a diagram illustrating the use of hops in a system in which a user is simultaneously connected to two networks. User 100 transmits a packet to gateway 102 which it intends to send to first network 104. Gateway 102 receives the packet and determines that it must be forwarded to the first network. Since there is no direct connection between the gateway 102 and the first network 104, it must pass it to a first hop 106, which then must examine the packet and determine that it should be passed along again (rather than sent to the local area network attached to first hop 106), so it passes it to second hop 108. This process continues until the packet reaches a hop 110 attached to first network 104.
One problem with using hops to examine and forward packets is that sometimes it may be necessary to route the packet through a particular ISP. For example, a user may sign up for service from a particular ISP. The ISP may offer varying levels of service, including faster network communications for its higher paying users. This is only one example of a reason to require that a packet be forwarded to a particular ISP. One of ordinary skill in the art will recognize that there may be other reasons why a gateway would need to forward a packet to a particular ISP. Whatever the reason, rather than simply forwarding packets to the Internet, it becomes necessary to guarantee that the packets travel through the particular ISP before being routed to the Internet.
What is further needed is a solution which allows a gateway to transmit packets through hops in a way that guarantees that the packets are routed through a particular ISP or network.
A gateway is provided which routes a packet sent from a user to a connected network utilizing a per user routing table. This is accomplished by extracting a source address from the packet; finding a per-user routing table corresponding to said source address, said per-user routing table containing entries corresponding to one or more currently accessible networks for the user and the range of network addresses corresponding to said currently accessible networks; extracting a destination address from the packet; seeking an entry in said matching per-user routing table with a range of network addresses containing said destination address; routing the packet to a matching network if said destination address is contained within one of said ranges of network addresses for said currently accessible networks; and routing the packet to a default network if said destination address is not contained within one of said ranges of network addresses for said currently accessible networks. This allows different users to have access to a different set of networks and allows a user to select the network he wishes to access. The gateway may also guarantee that packets are routed through a particular destination ISP or network by looking up said destination ISP or network in a table, each entry in said table having a router network address corresponding to each network currently accessible; establishing a tunneling session to said matching router network address; and forwarding the packet to said router network address through said tunneling session.